<?php
header('content-type:text/html;charset=utf-8');
date_default_timezone_set('PRC');
/**
 * Created by PhpStorm.
 * User: wangye
 * Date: 19-3-12
 * Time: 上午9:48
 */
$fileName = './text1.txt';
$dirName = 'dir';

echo filetype($fileName);
echo '<br>';
echo filetype($dirName);
echo '<br>';
echo 'file'.filesize($fileName);
echo '<br>';
echo 'dir'.filesize($dirName);
echo '<br>';
echo date('Y年m月d日 H:i:s',filectime($fileName));
echo '<br>';
print_r(pathinfo($fileName));
echo '<br>';
echo pathinfo($fileName,PATHINFO_EXTENSION);
echo '<br>';
echo 'PATHINFO_DIRNAME '.pathinfo($fileName,PATHINFO_DIRNAME);
echo '<br>';
$fileName = 'text2.txt';
var_dump(touch($fileName));

rename($fileName,'text3.txt');

if(file_exists($fileName)) {
    if(unlink($fileName)) {
        echo '文件删除成功';
    }else{
        echo '文件删除失败';
    }
}else{
    echo '删除文件不存在';
}
